$(function () {
  // 判断token是否存在

  if (localStorage.getItem('mytoken') == null) {
    location.href = '/login.html'
  }

  let layer = layui.layer
  // 退出按钮的点击事件
  $('#logout-btn').click(function () {
    layer.confirm('是否退出?', function (index) {
      location.href = "/login.html"
      localStorage.removeItem('mytoken')
      layer.close(index)
    })
  })

})